<template>
<div>
  <el-table :data="users" height="250" style="width: 100%">
    <el-table-column label="用户名" prop="username"></el-table-column>
    <el-table-column label="id" prop="_id"></el-table-column>
    <el-table-column label="操作" fixed="right" width="100">
      <template slot-scope="scope" >
        <el-button @click="phone(scope.row)" type="text">
          联系客户
        </el-button>
      </template>
    </el-table-column>
  </el-table>
</div>
</template>

<script>
    export default {
        name: "user-manage",
      data(){
          return{
            users:[]
          }
      },
      created() {
        this.getUser();
      },
      methods:{
        getUser(){
          this.axios.get('/api/admin/getUser')
          .then(res=>{
            this.users = res.data;
            console.log(res.data);
          })
        },
        phone(row){
          console.log(row.username);
        }
      }
    }
</script>

<style scoped>

</style>
